Skip to content

Claude/analyze cab files 01 th36 nsc pu3upp dch66b r tq#52

Merged
BenSweaterVest merged 5 commits into
mainfrom
claude/analyze-cab-files-01Th36NscPU3uppDCH66bRTq
Nov 16, 2025
Merged

Claude/analyze cab files 01 th36 nsc pu3upp dch66b r tq#52
BenSweaterVest merged 5 commits into
mainfrom
claude/analyze-cab-files-01Th36NscPU3uppDCH66bRTq

Conversation

@BenSweaterVest
Copy link
Copy Markdown
Owner

No description provided.

claude and others added 5 commits November 16, 2025 05:24
The import was still failing with attribute validation error:
"The format DateAndTime is not valid for the datetime type column pm_startdate"

After trying DateOnly (invalid) and DateAndTime (also invalid), it's now clear
that Dataverse for Teams does NOT support the Format element for datetime
fields at all.

ROOT CAUSE:
The Format element is not supported for datetime fields in Teams Dataverse.
When creating new datetime attributes, no format should be specified - the
system will use its default datetime behavior.

FIX:
Removed the <Format> element entirely from all 9 datetime fields:
- pm_StaffMember.pm_startdate
- pm_WeeklyEvaluation.pm_evaluationdate
- pm_SelfEvaluation.pm_evaluationdate
- pm_IDPEntry.pm_targetdate
- pm_MeetingNote.pm_meetingdate
- pm_Goal.pm_targetdate
- pm_Goal.pm_completiondate
- pm_Recognition.pm_recognitiondate
- pm_ActionItem.pm_duedate

BEFORE:
<Type>datetime</Type>
<Name>pm_startdate</Name>
<LogicalName>pm_startdate</LogicalName>
<RequiredLevel>none</RequiredLevel>
<DisplayMask>ValidForAdvancedFind</DisplayMask>
<Format>DateAndTime</Format>  ← REMOVED THIS LINE
<IntroducedVersion>2.0.0.0</IntroducedVersion>

AFTER:
<Type>datetime</Type>
<Name>pm_startdate</Name>
<LogicalName>pm_startdate</LogicalName>
<RequiredLevel>none</RequiredLevel>
<DisplayMask>ValidForAdvancedFind</DisplayMask>
<IntroducedVersion>2.0.0.0</IntroducedVersion>

File size: 9,053 lines → 9,043 lines (-10 lines)

NEW PACKAGE:
- PerformanceManagement_v2.0.0.0_NO_DATETIME_FORMAT.zip
- SHA256: 5abfed5d7e9cca96326355991ac87a2427ddd466213dcfa332ddeb9aacbb6002

This should resolve the datetime format validation error.
…them

The import was failing with attribute validation error:
"Attribute versionnumber is a BigInt, but a BigInt type was specified"

This confusing error occurs because we're defining system fields that Dataverse
will create automatically for new entities in unmanaged solutions.

ROOT CAUSE:
Similar to system relationships, system FIELDS should not be included in
solution packages for new entities. Dataverse automatically creates all
standard fields (CreatedOn, ModifiedOn, VersionNumber, OwnerId, etc.) when
the entity is registered.

Including these field definitions causes conflicts because Dataverse tries
to "update" fields that it's in the process of creating.

SYSTEM FIELDS (auto-created by Dataverse):
- createdby, createdon, createdonbehalfby
- modifiedby, modifiedon, modifiedonbehalfby
- ownerid, owningbusinessunit, owningteam, owninguser
- statecode, statuscode
- timezoneruleversionnumber, utcconversiontimezonecode
- versionnumber
- importsequencenumber
- overriddencreatedon

FIX:
Created remove_system_fields.py script to remove all fields where:
- IsCustomField = 0 (system field)
- Except primary key fields (Type = primarykey)

BEFORE:
- 181 total fields (162 system + 19 custom)
- 9,043 lines in customizations.xml

AFTER:
- 28 total fields (9 primary keys + 19 custom)
- 2,302 lines in customizations.xml
- File size reduced from 41KB to 21KB

Kept only:
✅ 9 primary key fields (pm_staffmemberid, pm_evaluationquestionid, etc.)
✅ 19 custom fields (our actual app fields)

Dataverse will auto-create all system fields during entity registration.

NEW PACKAGE:
- PerformanceManagement_v2.0.0.0_NO_SYSTEM_FIELDS.zip
- SHA256: 460b3f8d54514ea72d26ac8370ac89e2e9e01de74a9664366ba9d805b695fed2
- Size: 21KB (reduced from 41KB)

This should resolve the versionnumber attribute validation error.
The import was failing with error:
"PrimaryName attribute not found for Entity: pm_EvaluationQuestion"

ROOT CAUSE:
Every Dataverse entity MUST have a primary name field - a single-line text
field (nvarchar) that serves as the display name for records. This is like
"Full Name" for contacts or "Account Name" for accounts.

The primary name field must have:
- Type: nvarchar (single-line text, not memo)
- DisplayMask: Must include "PrimaryName"
- RequiredLevel: required
- MaxLength: Typically 100

FIX:
Added a pm_name field to all 9 entities as the primary name field.

Fields added:
- pm_StaffMember.pm_name - Employee name
- pm_EvaluationQuestion.pm_name - Question title
- pm_WeeklyEvaluation.pm_name - Evaluation name
- pm_SelfEvaluation.pm_name - Self-evaluation name
- pm_IDPEntry.pm_name - Development goal title
- pm_MeetingNote.pm_name - Meeting note title
- pm_Goal.pm_name - Goal title
- pm_Recognition.pm_name - Recognition title
- pm_ActionItem.pm_name - Action item description

Each field:
✅ Type: nvarchar
✅ MaxLength: 100
✅ DisplayMask: PrimaryName|ValidForAdvancedFind|ValidForForm|ValidForGrid|RequiredForForm
✅ RequiredLevel: required
✅ IsSearchable: 1, IsSortable: 1, IsFilterable: 1

File size: 2,302 lines → 2,662 lines (+360 lines for 9 primary name fields)

NEW PACKAGE:
- PerformanceManagement_v2.0.0.0_WITH_PRIMARY_NAMES.zip
- SHA256: 056116bf26542e4783ebd00079598e4c25a01ec4ed8f7ce048b61c18160f4b5a
- Size: 21KB

This should resolve the "PrimaryName attribute not found" error.
Fixed duplicate primary name field error by:
1. Restored customizations.xml from before duplicate addition
2. Created fix_primary_name_fields.py to update existing pm_name to required
3. Created add_missing_primary_names.py to add pm_name ONLY to:
   - pm_EvaluationQuestion
   - pm_IDPEntry
   - pm_Goal

All other entities (pm_StaffMember, pm_WeeklyEvaluation, pm_SelfEvaluation,
pm_MeetingNote, pm_Recognition, pm_ActionItem) already had pm_name fields.

Final state: All 9 entities have exactly one pm_name primary name field
Package: PerformanceManagement_v2.0.0.0_PRIMARY_NAMES_FIXED.zip (14KB)
SHA256: 553c9d80b6441a5d981bd6ecfd05688916ab86311c76df3a10a8208679c7c22d
@BenSweaterVest BenSweaterVest merged commit bb972ad into main Nov 16, 2025
2 checks passed
@BenSweaterVest BenSweaterVest deleted the claude/analyze-cab-files-01Th36NscPU3uppDCH66bRTq branch November 16, 2025 06:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants